<?php

namespace app\admin\controller;


use think\Request;
use think\Config;

class Wechat extends Base
{
    //页面加载
    public function index(){
        $data['data'] = Config::get('wechat');

        return $this->fetch('index',$data);
    }

    //数据处理
    public function store(Request $request){
        if (!$request->isPost()) return return_json();
        //获取提交过来的数组
        $data = $request->param()['data'];

        $rel = setconfig($data,'wechat',APP_PATH.'extra'.DS.'wechat.php');
        if ($rel){
            return return_json(0,'修改成功！');
        }
        return return_json(1,'修改失败！');
    }
}
